<template>
  <div class="child1">
    <h2>我是Child1组件</h2>
    <h3>当前的求和为：{{sum}}</h3>
    <button @click="add">点我sum+1</button>
    <hr>
    <h3>我想对你说：{{str}}</h3>
    <button @click="getText">点我获取一句土味情话</button>
  </div>
</template>

<script>
  import randomText from '../mixins/randomText'
  
  export default {
    name:'Child1',
    data() {
      return {
        sum:0,
      }
    },
    methods: {
      add(){
        this.sum += 1
      }
    },
    mixins:[randomText]
  }
</script>

<style scoped>
  .child1 {
    background-color: skyblue;
    padding: 20px;
  }
</style>